package com.yh.service.impl;

import com.yh.mapper.UserMapper;
import com.yh.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

public class UserServiceImpl  implements UserService {
    @Autowired
    UserMapper userMapper;
    @Override
    @Transactional
    public void test1(int uid, String username, String password, boolean isTrue) {
        userMapper.updateUsernameByUid(uid,username);
        if(isTrue){
            System.out.println(1/0);
        }
        userMapper.updatePasswordByUid(uid,password);
    }
}
